package tools

// IMTerminalType 用于表示不同的终端类型
type IMTerminalType int

const (
	WEB IMTerminalType = iota
	APP
	PC
)

var terminalTypes = []struct {
	Code IMTerminalType
	Desc string
}{
	{WEB, "web"},
	{APP, "app"},
	{PC, "pc"},
}

// Desc 返回终端类型的描述
func (t IMTerminalType) Desc() string {
	for _, terminal := range terminalTypes {
		if terminal.Code == t {
			return terminal.Desc
		}
	}
	return ""
}
